<script src="/vue.js"></script>

<div id="app">
    <input type="text" v-on:keyup.enter="onEnter" v-model="msg">
</div>

<script>
    var vm = new Vue ({
        el: "#app",
        data: {
            msg: ""
        },
        methods: {
            onEnter() {
                console.log(this.msg);
                console.log("你触发了回车事件");
            }
        }
    })
</script>

<style>

</style>